This repository was archived by the owner on Sep 2, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 176
Create a new incremental_substrategy for insert_overwrite and microbatch
#1415
Open
borjavb
wants to merge
13
commits into
dbt-labs:main
Choose a base branch
from
borjavb:insert-overwrite-opt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25e45c7 to
16be393
Compare
fixtures Create Features-20241229-174752.yaml
6580895 to
d2e321a
Compare
incremental_substrategy for insert_overwrite and microbatch
d2e321a to
5893789
Compare
06baa78 to
241119a
Compare
|
This PR has been marked as Stale because it has been open with no activity as of late. If you would like the PR to remain open, please comment on the PR or else it will be closed in 7 days. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
resolves dbt-labs/dbt-adapters#527
docs dbt-labs/docs.getdbt.com/#
Problem
By default, we are using a
MERGEoperation when running aninsert_overwriteormicrobatchoperation. But this is not the most performant solution. In fact, we have different options with their pros and cons. Currently we only rely onmergethat is not the best performant solution and it doesn't allow fully parallelism formicrobatchoperations.Solution
In this PR we propose adding a new
incremental_substrategyformicrobatchandinsert_overwritethat will allow the user to select the best logic based on their needs.Additionally, based on experience the best combo I've seen is:
For that reason, we can add an additional
optimisedoption that will run the best operation available (and that can be updated in the future if needed){{ config( incremental_strategy={ "insert_overwrite", "microbatch" }, incremental_substrategy={ 'merge', -- by default if no substrategy is specified 'copy_partitions', -- same as defined in partitions_by 'delete+insert', 'optimised' -- if partitions is defined (static), used delete+insert, if not (dynamic), use copy partitions }, ... ) }}Note that the copy_partitions will also be backwards compatible by checking if it has been defined in the
partition_byconfig block.We could force every user to use the
optimisedby default with the new release, but I just feel unease given thatmergehas been the default for ever and people might have built logics assuming this behaviour...?Checklist